#!/bin/bash
# 
# File: stop.sh
# Purpose: stop autossh for tunnel sites
#

cd $(dirname "$0")
. ./common.sh

INSTALLDIR=$(cd "$(dirname "$0")"; pwd);
info shutdown screen ...	
pids=$(screen -ls | grep 'autossh' | cut -d '.' -f 1);
if [ -n "$LOCAL_PORT" ] ; then
	for pid in $pids; do
		kill -9 $pid;
		info kill $pid success
	done
	screen -wipe >/dev/null || :
fi
